/** 
 * 弹窗文件
 */
export const toast =(title, duration = 1000,mask=true,icon = 'none')=>{
  wx.showToast({
    title: title,
    duration: duration,
    mask:mask,
    icon: icon,
  });
};

export const modal = (title='',content,showCancel=true,fn)=>{
  wx.showModal({
    title: title,
    content: content,
    showCancel:showCancel,
    confirmColor:'#FA6700',
    complete(result) {
      fn && fn(result);
    }
  });
};
export const showLoading = (title = '', icon = 'Loading', mask = true)=>{
  wx.showLoading({
    title: title,
    icon: icon,
    mask: mask
  });
};

export const hideLoading = (fn)=>{
  wx.hideLoading({
    complete(result) {
      fn && fn(result);
    }
  });
};